/**
 * appStateTuiyan
 */
import { defineStore } from "pinia";
import { ref, computed } from "vue";

export interface AppStateTuiyan {
  // 加载中
  spinning: boolean;
  spinningText: {
    change: boolean;
    text: string;
  };
}

export const appStateTuiyan = defineStore("app-store-tuiyan", () => {
  const spinning = ref(true);
  const spinningText = ref({
    change: false,
    text: "",
  });

  const getSpinning = computed(() => spinning.value);

  function setSpinning(param: boolean) {
    spinning.value = param;
  }

  return {
    spinning,
    spinningText,
    getSpinning,
    setSpinning
  };
});
